/*
 * Copyright (c) 2018. czmc All Rights Reserved.
 * Author: czmc
 * Email: zxc6355533@163.com
 * Encoding: UTF-8
 */

package top.stime21.myneighbours.module.home

import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter

/**
 * Author: czmc  Email: zxc6355533@163.com
 * Version:	1.0  Date:2018/3/1
 */
class HomeAdapter(fm: FragmentManager?) : FragmentPagerAdapter(fm) {
   private val titles:Array<String> = arrayOf("附近","全部")
    private val fragments:Array<Fragment> = arrayOf(NearByFragment(),AllFragment())
    override fun getPageTitle(position: Int): CharSequence {
        return titles.get(position)
    }
    override fun getItem(position: Int): Fragment {
       return fragments.get(position)
    }

    override fun getCount(): Int {
        return fragments.size
    }
}